<html><head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> 
	<script src='<?=_P("application/views/scripts/jquery-1.5.1.js")?>'></script>
	<style>
	
	</style> 
</head>
<body>
<script src="<?=_U("script/libraries/ex_snoopy")?>"></script>
<script>

/*$('.web_fetcher .delete').css('cursor','pointer');
$('.web_fetcher .delete').attr('is_deleted','false');
$('.web_fetcher .delete').click(function(){
	var me = $(this);
	var prev = $(this).prev().prev().prev().prev();
	var prev_id = prev.attr('id'); 
	db.del('web_fetcher',{id:prev_id},function(data){
		if(data.result)
		{
			me.parent().remove();
		}
		else
		{
			alert(data)  ; 
		}
	});
});
*/

$(document).ready(function(){
	/*$('#test').click(function(){
		ex_snoopy.fetch("http://www.baidu.com",function(data){
			//alert(data.result);
			$('#d').val(data.result); 
			document.write(data.result);
			//$('#c').html(data.result); 
		});
	});*/
	$('.web_fetcher .delete').css('cursor','pointer');
	$('.web_fetcher .delete').attr('is_deleted','false');
	$('.web_fetcher .delete').click(function(){
		//alert('abc');
		var me = $(this);
		//var prev = me.prev().prev().prev().prev();
		var prev = me.prev().prev().prev().prev().attr('id');
		var prev_id = prev[prev.length-1];
		alert(prev);
		db.del('web_fetcher',{id:prev_id},function(data){
			if(data.result)
			{
				me.parent().remove();
			}
			else
			{
				alert(data)  ; 
			}
		});
	});
});
	
</script>

<div style="margin:10px">
	<div class="line w_long" style="border:1px solid #c0c0c0;margin-bottom:10px">
		<div class="left" style="border:0px solid black"><strong>
			采集器列表
		</strong></div> 
		<div class="add"> 
			<a href='<?=_U("module/jr_web_fetcher/entry/edit")?>'>添加采集器</a>
		</div>
	</div>
	<div class="line"> 
		<form id="form1" action="/jr_cms/admin.php/page/index" method="post">
			<table class="datatable" style="width:100%;">
				<thead>
					<tr>
						<th width="100px">id</th>
						<th>采集器名</th>
						<th width="120px">采集器地址</th>
						<th width="66">&nbsp;</th>
					</tr>
				</thead>
				<tbody>
					<?php $web_fetcheres = $this->db->get('web_fetcher')->result();?>
					<?php foreach ($web_fetcheres as $web_fetcher):?>
					<tr class="web_fetcher">
						<th id=><?=$web_fetcher->id?></th>
						<th><?=$web_fetcher->title?></th>
						<th><?=$web_fetcher->url?></th>
						<th><a href='<?=_U("module/jr_web_fetcher/entry/edit?id=$web_fetcher->id")?>'>编辑</a></th> 
						<th class="delete"><a href='<?=_U("module/jr_web_fetcher/entry/")?>'>删除</a></th>
					</tr>
					<?php endforeach;?>
					<tr>
						<td colspan="7" style="background-color:#f9fcef;padding:5px 0px;text-align:center">
							<div class="jr_pager">
								<div class="jr_pager_indent">
									<table><tbody><tr>
										<td>
											<a url="/jr_cms/admin.php/page/index?&amp;page=1" style="cursor: pointer; ">
											<img src="/jr_cms/application/views/default/admin/images/first.gif">
											</a>
										</td>
										<td>
											<a url="/jr_cms/admin.php/page/index?&amp;page=1" style="cursor: pointer; "> 
											<img src="/jr_cms/application/views/default/admin/images/prev.gif">
											</a>
										</td>
										<td>
											<a url="/jr_cms/admin.php/page/index?&amp;page=1" style="cursor: pointer; ">
											<font style="color:red">[1]</font> 
											</a> 
										</td>
										<td>
											<a url="/jr_cms/admin.php/page/index?&amp;page=1" class="next" style="cursor: pointer; ">
											<img src="/jr_cms/application/views/default/admin/images/next.gif">
											</a>
										</td>
										<td>
											<a url="/jr_cms/admin.php/page/index?&amp;page=1" style="cursor: pointer; ">  
											<img src="/jr_cms/application/views/default/admin/images/last.gif"> 
											</a>
										</td>
									</tr></tbody></table>
								</div>
							</div> 
							<script>
							$(document).ready(function(){
								$('.jr_pager_indent a').css('cursor','pointer'); 
								$('.jr_pager_indent a').click(function(){
									form = (function(ob)
									{
										// alert(ob.parent().attr('tagName')); 
										if(ob.parent().attr('tagName').toUpperCase()=='FORM' || 
										   !ob.parent())
										{
											return ob.parent();
										}
										else
										{
											return arguments.callee(ob.parent());  
										}
									})($(this));
									
									url = $(this).attr('url');
									form.attr('action',url);
									form.submit(); 
								});
							});
							</script>			
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
</div>
</body>